#ifndef _THREAD_IMPL_H_
#define _THREAD_IMPL_H_

#include "Thread.h"
#include "TaskQueue.h"

class ThreadImpl :
	public Thread
{
public:
	virtual ~ThreadImpl();
	static ThreadImpl * create(TaskQueue *task);

// inherit
protected:
	virtual uint32_t get_handle() const;
	virtual uint32_t get_id() const;
	virtual uint32_t get_complete() const;
	virtual ThreadStatus get_status() const;
	virtual ThreadStatus start();
	virtual ThreadStatus suspend();
	virtual void destroy();
	virtual TaskQueue * get_task_queue() const;
	virtual void set_task_queue(TaskQueue *task_queue);

// 
protected:
	ThreadImpl();
	bool init(TaskQueue *task_queue);
	bool start_thread(void *param);

	uint32_t handle_;
	uint32_t id_;
	uint32_t complete_task_cnt_;
	ThreadStatus status_;
	TaskQueue *task_queue_;
};

#endif